package com.piaodekuai.flight.web;



//@RestController
//@Controller


import com.piaodekuai.flight.mapper.UserMapper;
import com.piaodekuai.flight.pojo.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class HelloController {

    @Autowired
    UserMapper userMapper;

    @RequestMapping("/userMapper")
    public String showUserMapper() throws Exception{

        User user = userMapper.selectByPrimaryKey(2);
        System.out.println(user.toString());
        return user.toString();
    }



   /*
   @RequestMapping("/Home")
    public String hello1(Model m) throws Exception {
        m.addAttribute("mess", "hello JSP");
        m.addAttribute("name","thymeleaf");

        if(false){
            throw new Exception("some exception");
        }

        //return "Hello Spring Boot!";
        return "Home";
    }*/




}